<?php

namespace pay\modules\backend\models;

use Yii;

/**
 * This is the model class for table "pay_merchants".
 *
 * @property int $mid
 * @property string $merchants 商户号
 * @property string $name 商户名称
 * @property string $phone 商户手机
 * @property string $email 邮箱
 * @property string $status 1-开放 2-禁用
 * @property string $type 1-私有，2-平台
 * @property string $private_key 商户秘钥
 * @property string $create_time 创建时间
 */
class Merchants extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'pay_merchants';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['merchants', 'name', 'phone', 'email', 'private_key', 'create_time'], 'required'],
            [['status', 'type'], 'string'],
            [['create_time'], 'safe'],
            [['merchants'], 'string', 'max' => 10],
            [['name', 'email'], 'string', 'max' => 32],
            [['phone'], 'string', 'max' => 11],
            [['private_key'], 'string', 'max' => 64],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'mid' => 'Mid',
            'merchants' => 'Merchants',
            'name' => 'Name',
            'phone' => 'Phone',
            'email' => 'Email',
            'status' => 'Status',
            'type' => 'Type',
            'private_key' => 'Private Key',
            'create_time' => 'Create Time',
        ];
    }
}
